<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>{$system_name}</title>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- No Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">
    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <!-- Tile icon for Win8 (144x144 + tile color) -->
    <meta name="msapplication-TileColor" content="#0e90d2">
    <!-- SEO: If your mobile URL is different from the desktop URL, add a canonical link to the desktop page https://developers.google.com/webmasters/smartphone-sites/feature-phones -->
    <!--
  <link rel="canonical" href="http://www.example.com/">
  -->
    <link rel="stylesheet" href="__PUBLIC__/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="__PUBLIC__/assets/css/app.css">
    <!--<link rel="stylesheet" href="__PUBLIC__/assets/css/index.css">-->
    <!--必要样式-->
    <style>

        .item-num {
            display: inline-block;
            width: 60px;
            background: #FEBF00;
            text-align: center;
            color: #FFF;
            font: bold 18px SimSun;
            line-height: 32px;
            border-bottom: 1px solid #FFF;
        }

        .item-type {
            display: inline-block;
            width: 60px;
            background: #FEBF00;
            text-align: center;
            color: #FFF;
            font: 10px SimSun;
            line-height: 24px;
        }

        .item{
            padding: 10px 6px 6px;
            border-bottom: 1px solid #d4d4d4;
        }
        .money{
            display: block;
            font-size: 14px;
            color: #251D02;
        }
        .kahao ,.jifen{
            display: block;
            font-size: 11px;
            color: #251D02;
            word-break: break-all;
        }
        .time{
            font-size: 12px;
            display: block;
            color: #251D02;
        }
    </style>
</head>

<body>
<header data-am-widget="header" class="am-header am-header-default">
    <div class="am-header-left am-header-nav">
        <a href="__APP__/Home/Me" class="">
            <img src="__PUBLIC__/assets/i/left.png" alt="" style="margin: 5px">
        </a>
    </div>
    <h1 class="am-header-title">
        <a href="#title-link" class="">
            我的领取记录
        </a>
    </h1>
</header>

<div class="wrap" id="order_list">

</div>




<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
    <div class="am-modal-dialog">
        <div class="am-modal-bd">

        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn" data-am-modal-cancel>取消</span>
            <span class="am-modal-btn" style="color: #0096FF;" data-am-modal-confirm>确定</span>
        </div>
    </div>
</div>

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="__PUBLIC__/assets/js/jquery.min.js"></script>
<script src="__PUBLIC__/assets/js/angular.min.js"></script>
<script src="__PUBLIC__/assets/js/amazeui.min.js"></script>
<script>
    var page=1; //当前页的页码
    var allpage =1; //总页码，会从后台获取
    $(function () {
        getOrderListByPage(1);
    });

    function scrollFn(){
        allpage = $('#totalpage').val();
        //真实内容的高度
        var pageHeight = Math.max(document.body.scrollHeight,document.body.offsetHeight);
        //视窗的高度
        var viewportHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;
        //隐藏的高度
        var scrollHeight = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
        if(pageHeight - viewportHeight - scrollHeight < 20){  //如果满足触发条件，执行
            if(page <= allpage) {
                getOrderList();
            }
        }
    }
    $(window).bind("scroll",scrollFn);  //绑定滚动事件
    function getOrderListByPage(pagenum) {
        getOrderList();
    }
    function getOrderList() {
        $.ajax({
            type: "POST",
            url: "__URL__/ajaxOrderList",
            async: false,
            data: {
                pagenum: page
            },
//            dataType: "json",
            success: function (data) {
//                console.info(data);
                page++;  //页数加1
                $('#order_list').append(data);
                AMUI.gallery.init();
//                $("img .lazy").lazyload();
            },
            error: function (data) {
                console.info(data);
            }
        });
    }
</script>
</body>
</html>

